const UserModel = require('../../model')

exports.addLike = (req, res) => {
  const data = req.body
  console.log(data, 'data');
  const addLike = UserModel.LikeSchema({
    ...data
  })
  addLike.save((err, result) => {
    if (err) return res.cc(err)
    res.send({ status: 200, message: '点赞成功' })
  })
}

exports.delLike = (req, res) => {
  const data = req.body
  UserModel.LikeSchema.findOneAndDelete({
    u_id: data.u_id,
    article_id: data.article_id
  }, (err, result) => {
    if (err) res.cc(err)
    res.send({
      status: 200,
      result
    })
  })
  UserModel.LikeSchema.find
}